package cn.com.fuhuitong.main.mine.vm

import android.app.Application
import androidx.lifecycle.MutableLiveData
import cn.com.fuhuitong.app.BaseApplication
import cn.com.fuhuitong.base.BaseViewModel
import cn.com.fuhuitong.http.BaseResponse
import cn.com.fuhuitong.http.HttpResponse
import cn.com.fuhuitong.http.ViewModelSubscribeListener
import cn.com.fuhuitong.main.home.entity.CharityListResponse
import cn.com.fuhuitong.main.home.entity.HomeResponse
import cn.com.fuhuitong.main.mine.entity.*
import cn.com.fuhuitong.main.mine.mode.MineManager
import cn.com.fuhuitong.main.order.mode.OrderManager
import io.reactivex.disposables.Disposable

class ProfileViewModel(application: Application) : BaseViewModel(application) {

    private val mineManager: MineManager = MineManager()

    val baseDataLiveData = MutableLiveData<HttpResponse<BaseResponse>>()

    /**
     * 申请提现
     */
    fun editUserNickname(nickname: String) {
        val listener =
            object :
                ViewModelSubscribeListener<BaseResponse>(baseDataLiveData) {}
        val editUserNicknameDisposable: Disposable = mineManager.editUserNickname(
            BaseApplication.userToken(), nickname, listener
        )
        dispose.add(editUserNicknameDisposable)
    }

}